
import { useEffect } from 'react';
import isString from 'lodash/isString';
import Taro from '@tarojs/taro';


export const usePageTitle = (val) => {
  useEffect(()=>{
    let title = isString(val) ? val : val?.title;
    Taro.setNavigationBarTitle({
      title: title,
    })
  }, [val]);
}


